#include "CocosPCH.h"
#include "CoCElementColorTransform.h"

#include "Utility.h"

struct ColorTransform {
	char rm, gm, bm, am;
	char ra, ga, ba;
};


CoCElementColorTransform::CoCElementColorTransform(void)
{
}


CoCElementColorTransform::~CoCElementColorTransform(void)
{
}

bool CoCElementColorTransform::Parse(void *data, CoCSWF *pSWF)
{		
	int nDataPos = 0;
	ColorTransform colorTrans;
	Utility_ReadValue(&colorTrans, data, &nDataPos);

	m_Color.r = colorTrans.ra;
	m_Color.g = colorTrans.ga;
	m_Color.b = colorTrans.ba;
	m_Color.a = colorTrans.am;

	return true;
}

Color4B *CoCElementColorTransform::GetColor()
{
	return &m_Color;
}